#include <stdio.h>
#include <math.h>
#include <malloc.h>

typedef unsigned int u32; // 10^8
int main()
{
    u32 cnt = 0;
    float sq = 0;
    scanf("%d", &cnt);
    u32 *data = malloc(cnt * sizeof(u32));
    u32 *data_cnt = malloc(cnt * sizeof(u32));
    for (int i = 0; i < cnt; i++)
        scanf("%d", &data[i]);
    for (int i = 0; i < cnt; i++)
    {
        sq = sqrt(data[i]);//
        data_cnt[i] = 0;
        for (int j = 1; j <= sq; j++)
            if (data[i] % j == 0)
            {
                if(j!=1 && (data[i] / j) % j == 0)//GCD
                    continue;
                data_cnt[i] += 1;
            }
                
                
    }
    for (int i = 0; i < cnt; i++)
        printf("%d\n", data_cnt[i]);
    return 0;
}